package thread;

import java.util.PriorityQueue;

public class demo18 {

    public static void main(String[] args) {
        Object locker=new Object();
        int count=0;
        for (int i = 0; i < 10; i++) {
            synchronized (locker){
                //这里又加锁
                synchronized (locker){
                    count++;
                }
            }
        }
        System.out.println(count);
    }



}
